package com.hg.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hg.mapper.ItemCatMapper;
import com.hg.pojo.ItemCat;
import com.hg.service.IItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Wrapper;
import java.util.List;

/**
 * <p>
 * 商品类目 服务实现类
 * </p>
 *
 * @author Baomidou
 * @since 2025-07-30
 */
@Service
public class ItemCatServiceImpl extends ServiceImpl<ItemCatMapper, ItemCat> implements IItemCatService {
    @Autowired
    private ItemCatMapper itemCatMapper;

    @Override
    public List<ItemCat> selectItemCategoryByParentId(Long id) {
        QueryWrapper<ItemCat> QueryWrapper = new QueryWrapper<>();
        QueryWrapper.eq("parent_id", id);
        List<ItemCat> itemCatList = itemCatMapper.selectList(QueryWrapper);
        return itemCatList;
    }
}
